package com.isoft.demooa.service;

import com.isoft.demooa.dao.UserMapper;
import com.isoft.demooa.entity.ResponseMessage;
import com.isoft.demooa.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Service
public class UserService {

      @Autowired
      private UserMapper userMapper;

      public List<User> getAll(){

          return  userMapper.selectAll();
      }


      public ResponseMessage login(User user){
           ResponseMessage responseMessage = new ResponseMessage();

           if(userMapper.exists(user)>0){
               responseMessage.setFlag(true);
           }
           return  responseMessage;

      }
}
